<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: cordic/cordic.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_a674585e0fd636fbc3b91e5f7b647f01.html">cordic</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">cordic.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="cordic_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// Run a standalone test</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">// #define TEST</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="cordic_8c.html#a575a13df8fab592b70c5968d27dbd338">   35</a></span>&#160;<span class="preprocessor">#define CORDIC_TABLE  </span><span class="comment">/* include the generated Cordic table */</span><span class="preprocessor"></span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#ifdef TEST</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#define MEMSPACE   </span><span class="comment">/* */</span><span class="preprocessor"></span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="user__config_8h.html">user_config.h</a>&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mathio_8h.html">printf/mathio.h</a>&quot;</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;math.h&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cordic2c__inc_8h.html">cordic2c_inc.h</a>&quot;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cordic_8h.html">cordic.h</a>&quot;</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="cordic_8h.html#a0de74b8b36857d95aadfc48438b64259">   57</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="cordic_8c.html#a0de74b8b36857d95aadfc48438b64259">deg2rad</a>(<span class="keywordtype">double</span> deg)</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keywordflow">return</span> (deg * M_PI / 180.0);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;}</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="cordic_8h.html#a132f4d86aeaa02138e534f93cbf69757">   71</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="cordic_8c.html#ae1719101cd5b3cb0c89cf03c436c551e">angle_quad</a>(<span class="keywordtype">double</span> quads, <span class="keywordtype">int</span> *quad)</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordtype">int</span> s,q;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">double</span> intpart;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    s = 0;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">if</span>(quads &lt; 0.0)</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    {</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        quads = -quads;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        s = 4;                                    <span class="comment">// sign information flag</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    quads = modf(quads, &amp;intpart);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    q = intpart;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    q &amp;= 3;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    q |= s;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    *quad = q;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">return</span>(quads);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;}</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">  102</a></span>&#160;<a class="code" href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a> <a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a>,<a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a>,<a class="code" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a>;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="cordic_8h.html#a9e686d8e990a05ea18655a368e6d1918">  103</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#a9e686d8e990a05ea18655a368e6d1918">Circular</a> (<a class="code" href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a> <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>, <a class="code" href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a> <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>, <a class="code" href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a> z)</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;{</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a> = <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a> = <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <a class="code" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a> = z;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="cordic2c__inc_8h.html#ad0c9c86596235ca7b3e113b12aeeafa0">Cordic_T_Bits</a>; ++i)</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    {</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        x = <a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a> &gt;&gt; i;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        y = <a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a> &gt;&gt; i;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">if</span>(i &lt; 14)</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            z = <a class="code" href="cordic2c__inc_8h.html#abfedbfddd3d22467322bc0ad058d2500">v_atangrad</a>[i];</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        <span class="keywordflow">else</span></div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;            z &gt;&gt;= 1;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a> &gt;= 0)</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            <a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a> -= <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a> += <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <a class="code" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a> -= z;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="keywordflow">else</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        {</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            <a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a> += <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            <a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a> -= <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            <a class="code" href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a> += z;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        }</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    }</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;}</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="cordic_8h.html#ab9bc8a20d99938e647047015d62f6f86">  144</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#ab9bc8a20d99938e647047015d62f6f86">cordic_quad</a>(<span class="keywordtype">double</span> angle, <span class="keywordtype">double</span> *s, <span class="keywordtype">double</span> *c)</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;{</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="preprocessor">#ifdef TEST</span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordtype">double</span> ts,tc;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <span class="keywordtype">double</span> es,ec;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keywordtype">double</span> degree, rad, orig;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordtype">double</span> cs,cc;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordtype">double</span> quads, tmp;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordtype">int</span> quad;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <a class="code" href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a> a;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    quads = <a class="code" href="cordic_8c.html#ae1719101cd5b3cb0c89cf03c436c551e">angle_quad</a>(angle,&amp;quad);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    a = <a class="code" href="cordic2c__inc_8h.html#ad614e1a545ad0fd263ea0afb0456cb7a">FP2Cordic</a>(quads);                         <span class="comment">/* convert to CORDIC fixed point */</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <a class="code" href="cordic_8c.html#a9e686d8e990a05ea18655a368e6d1918">Circular</a>(<a class="code" href="cordic2c__inc_8h.html#a4b976fbfc7fdff42650fe0419698cabf">Cordic_K</a>,0,a);</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    cc = <a class="code" href="cordic2c__inc_8h.html#a20ea29e123c9dc91c52635b0ffee975d">Cordic2FP</a>(<a class="code" href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a>);</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    cs = <a class="code" href="cordic2c__inc_8h.html#a20ea29e123c9dc91c52635b0ffee975d">Cordic2FP</a>(<a class="code" href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a>);</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="comment">// Angle 90 to &lt; 180 degrees swap sin and cos, and negate cos</span></div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordflow">if</span>(quad &amp; 1)</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    {</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        tmp = cc;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        cc = cs;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        cs = tmp;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        cc = -cc;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    }</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment">// Angle 180 &gt;.. 270 degrees negate both cos and sin</span></div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keywordflow">if</span>(quad &amp; 2 )</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    {</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        cs = -cs;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        cc = -cc;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    }</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment">// Angle &lt; 0 degrees negate only sin</span></div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="keywordflow">if</span>(quad &amp; 4 )</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    {</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        cs = -cs;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    }</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    *c = cc;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    *s = cs;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="comment">// Test difference between CORDIC and LIBC cos() and sin()</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="preprocessor">#ifdef TEST</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    degree = angle * 90;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    rad = angle * M_PI / 2.0;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    tc = cos(rad);</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    ts = sin(rad);</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    ec = cc - tc;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    es = cs - ts;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <a class="code" href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a>(<span class="stringliteral">&quot;Degree:%lf, rad:%lf, quad:%d\n&quot;</span>,</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        (<span class="keywordtype">double</span>)angle, (<span class="keywordtype">double</span>) rad, (<span class="keywordtype">int</span>)quad);</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <a class="code" href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a>(<span class="stringliteral">&quot;ccos:%lf, cos:%lf, error:%lf\n&quot;</span>,</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        cc, tc, ec);</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <a class="code" href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a>(<span class="stringliteral">&quot;csin:%lf, sin:%lf, error:%lf\n&quot;</span>,</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        cs, ts, es);</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;}</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="cordic_8h.html#a5d8ba4ae520a41add87512173a9289ef">  215</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(<span class="keywordtype">double</span> deg, <span class="keywordtype">double</span> *s, <span class="keywordtype">double</span> *c)</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;{</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <a class="code" href="cordic_8c.html#ab9bc8a20d99938e647047015d62f6f86">cordic_quad</a>(deg/90.0, s, c);</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00228"></a><span class="lineno"><a class="line" href="cordic_8h.html#ab5dff4f6a6c29502d824cc7574c13f1c">  228</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#ab5dff4f6a6c29502d824cc7574c13f1c">cordic_rad</a>(<span class="keywordtype">double</span> rad, <span class="keywordtype">double</span> *s, <span class="keywordtype">double</span> *c)</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;{</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <a class="code" href="cordic_8c.html#ab9bc8a20d99938e647047015d62f6f86">cordic_quad</a>(rad * 2.0 /M_PI, s, c);</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;}</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="cordic_8h.html#ae708dfda7767e28c3faeedf2c46deafd">  239</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#ae708dfda7767e28c3faeedf2c46deafd">scale_point</a>(<a class="code" href="structpoint.html">point</a> *P, <span class="keywordtype">double</span> scale)</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;{</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a> *= scale;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a> *= scale;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> *= scale;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;}</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="cordic_8h.html#a11f885e103030cb15b2f3477e21b780f">  252</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#a11f885e103030cb15b2f3477e21b780f">shift_point</a>(<a class="code" href="structpoint.html">point</a> *P, <a class="code" href="structpoint.html">point</a> *shift)</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;{</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a> += shift-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a>;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a> += shift-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a>;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> += shift-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a>;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;}</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="cordic_8h.html#a11674104e89537aef6922d07f34e62ae">  265</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#a11674104e89537aef6922d07f34e62ae">rotate</a>(<a class="code" href="structpoint.html">point</a> *P, <a class="code" href="structpoint.html">point</a> *V)</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;{</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keywordtype">double</span> sinx, siny, sinz, cosx, cosy, cosz;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>,<a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>,z,x1,y1,z1;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="comment">// Point</span></div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    x = P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a>;</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    y = P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a>;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    z = P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a>;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<span class="comment">// Transform Point</span></div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="comment">// View is in degrees</span></div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(V-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a>, &amp;sinx, &amp;cosx);</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(V-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a>, &amp;siny, &amp;cosy);</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(V-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a>, &amp;sinz, &amp;cosz);</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    x1 = x*cosz + y*sinz;                         <span class="comment">// Rotation around axis Z</span></div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    y1 = -x*sinz + y*cosz;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    z1 = z;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    x = x1;                                       <span class="comment">// Rotation around axis X</span></div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    y = y1*cosx + z1*sinx;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    z = -y1*sinx + z1*cosx;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    x1 = x*cosy - z*siny;                         <span class="comment">// Rotation around axis Y</span></div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    y1 = <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    z1 = x*siny + z*cosy;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;<span class="comment">// Transformed point</span></div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a> = x1;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a> = y1;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> = z1;</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;}</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="comment"> @brief // Perspective Projection with Offset and Scale</span></div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;<span class="comment"> @param[in] *P: x,y,z point, out: x,y ( z = 0 )</span></div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;<span class="comment"> @param [in] scale: scale factor</span></div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;<span class="comment"> @param [out] x: X offset</span></div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;<span class="comment"> @param [out] y: Y offset</span></div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="comment"> @return void</span></div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a> </div><div class="line"><a name="l00310"></a><span class="lineno"><a class="line" href="cordic_8h.html#a793b036235e0fdd6e799866fcb14e7e4">  310</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cordic_8c.html#a793b036235e0fdd6e799866fcb14e7e4">PerspectiveProjection</a>(<a class="code" href="structpoint.html">point</a> *P, <span class="keywordtype">double</span> scale, <span class="keywordtype">int</span> <a class="code" href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a>, <span class="keywordtype">int</span> <a class="code" href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a>)</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;{</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a> = (P-&gt;<a class="code" href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">x</a> + P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> / 2) * scale + x;</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a> = (P-&gt;<a class="code" href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">y</a> - P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> / 2) * scale + y;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    P-&gt;<a class="code" href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">z</a> = 0;</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;}</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;<span class="preprocessor">#ifdef TEST</span></div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="keywordtype">int</span> <a class="code" href="send_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a>()</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;{</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    <span class="keywordtype">double</span> d;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    <span class="keywordtype">double</span> s,c;</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    i = 0;</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;<span class="comment">// Make sure CORIC converges correctly over a few rotations</span></div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    <span class="keywordflow">for</span>(d=0;d&lt;=360;d+=45)</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    {</div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(d-1,&amp;s,&amp;c);</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(d,&amp;s,&amp;c);</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        <a class="code" href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a>(d+1,&amp;s,&amp;c);</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    }</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <span class="keywordflow">return</span>(0);</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;}</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;</div><div class="ttc" id="user__config_8h_html"><div class="ttname"><a href="user__config_8h.html">user_config.h</a></div><div class="ttdoc">Master include file for project Includes all project includes and defines here. </div></div>
<div class="ttc" id="cordic_8c_html_a11f885e103030cb15b2f3477e21b780f"><div class="ttname"><a href="cordic_8c.html#a11f885e103030cb15b2f3477e21b780f">shift_point</a></div><div class="ttdeci">MEMSPACE void shift_point(point *P, point *shift)</div><div class="ttdoc">Shift x,y,z by shift. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00252">cordic.c:252</a></div></div>
<div class="ttc" id="cordic_8c_html_a46b4b48ef8c0c01099eb3bcdde8aa8db"><div class="ttname"><a href="cordic_8c.html#a46b4b48ef8c0c01099eb3bcdde8aa8db">X</a></div><div class="ttdeci">Cordic_T X</div><div class="ttdoc">Main Cordic routine - used for basic trig and vector rotations We use fixed point numbers...</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00102">cordic.c:102</a></div></div>
<div class="ttc" id="cordic_8c_html_a0de74b8b36857d95aadfc48438b64259"><div class="ttname"><a href="cordic_8c.html#a0de74b8b36857d95aadfc48438b64259">deg2rad</a></div><div class="ttdeci">MEMSPACE double deg2rad(double deg)</div><div class="ttdoc">Convert Degrees to Rads. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00057">cordic.c:57</a></div></div>
<div class="ttc" id="cordic_8c_html_a5d8ba4ae520a41add87512173a9289ef"><div class="ttname"><a href="cordic_8c.html#a5d8ba4ae520a41add87512173a9289ef">cordic_deg</a></div><div class="ttdeci">MEMSPACE void cordic_deg(double deg, double *s, double *c)</div><div class="ttdoc">Compute Sin and Cos from angle in degrees using Cordic. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00215">cordic.c:215</a></div></div>
<div class="ttc" id="ili9341_8c_html_afe490938209e0b6b15224c05a01f0b40"><div class="ttname"><a href="ili9341_8c.html#afe490938209e0b6b15224c05a01f0b40">y</a></div><div class="ttdeci">int16_t y[XYSTACK+2]</div><div class="ttdef"><b>Definition:</b> <a href="ili9341_8c_source.html#l00372">ili9341.c:372</a></div></div>
<div class="ttc" id="cordic_8c_html_ab746e677f466f17031e92ed577fc3c15"><div class="ttname"><a href="cordic_8c.html#ab746e677f466f17031e92ed577fc3c15">Y</a></div><div class="ttdeci">Cordic_T Y</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00102">cordic.c:102</a></div></div>
<div class="ttc" id="cordic2c__inc_8h_html_a20ea29e123c9dc91c52635b0ffee975d"><div class="ttname"><a href="cordic2c__inc_8h.html#a20ea29e123c9dc91c52635b0ffee975d">Cordic2FP</a></div><div class="ttdeci">#define Cordic2FP(a)</div><div class="ttdef"><b>Definition:</b> <a href="cordic2c__inc_8h_source.html#l00020">cordic2c_inc.h:20</a></div></div>
<div class="ttc" id="cordic_8c_html_ab5dff4f6a6c29502d824cc7574c13f1c"><div class="ttname"><a href="cordic_8c.html#ab5dff4f6a6c29502d824cc7574c13f1c">cordic_rad</a></div><div class="ttdeci">MEMSPACE void cordic_rad(double rad, double *s, double *c)</div><div class="ttdoc">Compute Sin and Cos from angle in Rads using Cordic. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00228">cordic.c:228</a></div></div>
<div class="ttc" id="ili9341_8c_html_a12ad102c2d1e7e119fdc040b0c922c7e"><div class="ttname"><a href="ili9341_8c.html#a12ad102c2d1e7e119fdc040b0c922c7e">x</a></div><div class="ttdeci">int16_t x[XYSTACK+2]</div><div class="ttdef"><b>Definition:</b> <a href="ili9341_8c_source.html#l00371">ili9341.c:371</a></div></div>
<div class="ttc" id="cordic2c__inc_8h_html_ad614e1a545ad0fd263ea0afb0456cb7a"><div class="ttname"><a href="cordic2c__inc_8h.html#ad614e1a545ad0fd263ea0afb0456cb7a">FP2Cordic</a></div><div class="ttdeci">#define FP2Cordic(a)</div><div class="ttdef"><b>Definition:</b> <a href="cordic2c__inc_8h_source.html#l00021">cordic2c_inc.h:21</a></div></div>
<div class="ttc" id="cordic_8c_html_a793b036235e0fdd6e799866fcb14e7e4"><div class="ttname"><a href="cordic_8c.html#a793b036235e0fdd6e799866fcb14e7e4">PerspectiveProjection</a></div><div class="ttdeci">MEMSPACE void PerspectiveProjection(point *P, double scale, int x, int y)</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00310">cordic.c:310</a></div></div>
<div class="ttc" id="structpoint_html_a613f8f0d7352731638b0094e1b958b87"><div class="ttname"><a href="structpoint.html#a613f8f0d7352731638b0094e1b958b87">point::y</a></div><div class="ttdeci">double y</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8h_source.html#l00040">cordic.h:40</a></div></div>
<div class="ttc" id="cordic_8h_html"><div class="ttname"><a href="cordic_8h.html">cordic.h</a></div><div class="ttdoc">Cordic Routines Handle angle outside of the first quadrant Added standalone test to verify CORDIC aga...</div></div>
<div class="ttc" id="cordic2c__inc_8h_html_a97ad155ac7434ee543385126cd1d3313"><div class="ttname"><a href="cordic2c__inc_8h.html#a97ad155ac7434ee543385126cd1d3313">Cordic_T</a></div><div class="ttdeci">int Cordic_T</div><div class="ttdef"><b>Definition:</b> <a href="cordic2c__inc_8h_source.html#l00009">cordic2c_inc.h:9</a></div></div>
<div class="ttc" id="cordic_8c_html_a3da94d1c83a43c30add6c05fbbe1f194"><div class="ttname"><a href="cordic_8c.html#a3da94d1c83a43c30add6c05fbbe1f194">Z</a></div><div class="ttdeci">Cordic_T Z</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00102">cordic.c:102</a></div></div>
<div class="ttc" id="cordic_8c_html_ae708dfda7767e28c3faeedf2c46deafd"><div class="ttname"><a href="cordic_8c.html#ae708dfda7767e28c3faeedf2c46deafd">scale_point</a></div><div class="ttdeci">MEMSPACE void scale_point(point *P, double scale)</div><div class="ttdoc">Scale x,y,z by scale factor. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00239">cordic.c:239</a></div></div>
<div class="ttc" id="send_8c_html_a0ddf1224851353fc92bfbff6f499fa97"><div class="ttname"><a href="send_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a></div><div class="ttdeci">int main(int argc, char *argv[])</div><div class="ttdef"><b>Definition:</b> <a href="send_8c_source.html#l00148">send.c:148</a></div></div>
<div class="ttc" id="cordic2c__inc_8h_html_abfedbfddd3d22467322bc0ad058d2500"><div class="ttname"><a href="cordic2c__inc_8h.html#abfedbfddd3d22467322bc0ad058d2500">v_atangrad</a></div><div class="ttdeci">const Cordic_T v_atangrad[]</div></div>
<div class="ttc" id="mathio_8h_html"><div class="ttname"><a href="mathio_8h.html">mathio.h</a></div><div class="ttdoc">Math IO functions, and verious conversion code with floating point support. </div></div>
<div class="ttc" id="structpoint_html_a9c6b34deaf4900ad4193c17935fd384a"><div class="ttname"><a href="structpoint.html#a9c6b34deaf4900ad4193c17935fd384a">point::x</a></div><div class="ttdeci">double x</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8h_source.html#l00039">cordic.h:39</a></div></div>
<div class="ttc" id="structpoint_html"><div class="ttname"><a href="structpoint.html">point</a></div><div class="ttdoc">Point definition. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8h_source.html#l00037">cordic.h:37</a></div></div>
<div class="ttc" id="cpu_8h_html_ad0fe97585b8891f5e4f2b9a6426330a4"><div class="ttname"><a href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="ttdeci">#define MEMSPACE</div><div class="ttdef"><b>Definition:</b> <a href="cpu_8h_source.html#l00025">cpu.h:25</a></div></div>
<div class="ttc" id="mathio_8h_html_ad6078f8da2d30ecaef99e0c2d250c0c8"><div class="ttname"><a href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a></div><div class="ttdeci">MEMSPACE int printf(const char *format,...)</div></div>
<div class="ttc" id="cordic2c__inc_8h_html"><div class="ttname"><a href="cordic2c__inc_8h.html">cordic2c_inc.h</a></div></div>
<div class="ttc" id="cordic_8c_html_ab9bc8a20d99938e647047015d62f6f86"><div class="ttname"><a href="cordic_8c.html#ab9bc8a20d99938e647047015d62f6f86">cordic_quad</a></div><div class="ttdeci">MEMSPACE void cordic_quad(double angle, double *s, double *c)</div><div class="ttdoc">Compute Sin and Cos from angle in quads using Cordic. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00144">cordic.c:144</a></div></div>
<div class="ttc" id="cordic_8c_html_ae1719101cd5b3cb0c89cf03c436c551e"><div class="ttname"><a href="cordic_8c.html#ae1719101cd5b3cb0c89cf03c436c551e">angle_quad</a></div><div class="ttdeci">MEMSPACE double angle_quad(double quads, int *quad)</div><div class="ttdoc">Compute quadrant of angle and the quadrant modulus Note: Integer part is quadrant. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00071">cordic.c:71</a></div></div>
<div class="ttc" id="cordic2c__inc_8h_html_a4b976fbfc7fdff42650fe0419698cabf"><div class="ttname"><a href="cordic2c__inc_8h.html#a4b976fbfc7fdff42650fe0419698cabf">Cordic_K</a></div><div class="ttdeci">#define Cordic_K</div><div class="ttdef"><b>Definition:</b> <a href="cordic2c__inc_8h_source.html#l00015">cordic2c_inc.h:15</a></div></div>
<div class="ttc" id="structpoint_html_aab1f0c3682401083b5bf252e7001874f"><div class="ttname"><a href="structpoint.html#aab1f0c3682401083b5bf252e7001874f">point::z</a></div><div class="ttdeci">double z</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8h_source.html#l00041">cordic.h:41</a></div></div>
<div class="ttc" id="cordic_8c_html_a9e686d8e990a05ea18655a368e6d1918"><div class="ttname"><a href="cordic_8c.html#a9e686d8e990a05ea18655a368e6d1918">Circular</a></div><div class="ttdeci">void Circular(Cordic_T x, Cordic_T y, Cordic_T z)</div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00103">cordic.c:103</a></div></div>
<div class="ttc" id="cordic2c__inc_8h_html_ad0c9c86596235ca7b3e113b12aeeafa0"><div class="ttname"><a href="cordic2c__inc_8h.html#ad0c9c86596235ca7b3e113b12aeeafa0">Cordic_T_Bits</a></div><div class="ttdeci">#define Cordic_T_Bits</div><div class="ttdef"><b>Definition:</b> <a href="cordic2c__inc_8h_source.html#l00012">cordic2c_inc.h:12</a></div></div>
<div class="ttc" id="cordic_8c_html_a11674104e89537aef6922d07f34e62ae"><div class="ttname"><a href="cordic_8c.html#a11674104e89537aef6922d07f34e62ae">rotate</a></div><div class="ttdeci">MEMSPACE void rotate(point *P, point *V)</div><div class="ttdoc">Rotate point P by View point. </div><div class="ttdef"><b>Definition:</b> <a href="cordic_8c_source.html#l00265">cordic.c:265</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
